<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.cxk.hr.pojo.*" %>
<%@ page import="com.cxk.hr.util.*" %>
<% String path = request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>HR医院 - 员工考勤列表</title>
	<meta name="keywords" content="">
	<meta name="description" content="">

	<link rel="shortcut icon" href="favicon.ico">
	<link href="<%=path %>/statics/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="<%=path %>/statics/css/font-awesome.css?v=4.4.0" rel="stylesheet">

	<!-- Data Tables -->
	<link href="<%=path %>/statics/css/plugins/dataTables/dataTables.bootstrap.css"
		rel="stylesheet">
	<link href="<%=path %>/statics/css/animate.css" rel="stylesheet">
	<link href="<%=path %>/statics/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>员工考勤列表</h5>
					</div>
					<input type="sumbit" onclick="export_excel()" value="导出报表" class="btn btn-success">
					<div class="ibox-content">
						<table id="table1" class="table table-striped table-bordered table-hover dataTables-example">
							<thead>
								<tr>
									<th>序号</th>
									<th>工号</th>
									<th>姓名</th>
									<th>日期</th>
									<th>时间</th>
									<th>上班签到时间</th>
									<th>签到类别</th>
									<th>下班签到时间</th>
									<th>签到类别</th>
								</tr>
							</thead>
							<tbody>
							 <%
                            	List<Attendance> list = (List<Attendance>)request.getAttribute("att");
                            	int index=1;
                            	for(Attendance attendance : list){
                            %> 
								<tr class="gradeA">
									 <td><%=index++ %></td>
									<td><%=attendance.getEmployeeNumber() %></td>
									<td><%=attendance.getEmployee().getName() %></td>
									<%
										String day = MTimeUtil.dateFormat(attendance.getDay());
										String startTime = MTimeUtil.timeFormat(attendance.getStartTime());
										if(startTime == null) startTime="";
										String endTime = MTimeUtil.timeFormat(attendance.getEndTime());
										if(endTime == null) endTime="";
									%> 
									 <td><%=day %></td>
									<td><%=attendance.getTimeType() %></td>
									<td><%=startTime %></td>
									<td><%=attendance.getStartType() %></td>
									<td><%=endTime %></td>
									<td><%=attendance.getEndType() %></td> 
							</tr>
						      <%
                            	}
                             %>  
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 全局js -->
	<script src="<%=path %>/statics/js/jquery.min.js?v=2.1.4"></script>
	<script src="<%=path %>/statics/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="<%=path %>/statics/js/plugins/jeditable/jquery.jeditable.js"></script>
	<script src="<%=path %>/statics/js/tableExport.js"></script>
	<!-- Data Tables -->
	<script src="<%=path %>/statics/js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="<%=path %>v/js/plugins/dataTables/dataTables.bootstrap.js"></script>
	
	
	<script>
	 function export_excel() {
	        $('#table1').tableExport({
	　　　　　　　　type:'excel',
	　　　　　　　　fileName:new Date().getTime(),
	　　　　　　　　escape:'false'
	　　　　　　});
	    }
	</script>
</body>
</html>
